package com.tedu.homework;

import java.util.Scanner;

/*
* 本类打印等腰三角形
* */
public class TesTriangle {
    public static void main(String[] args) {
        System.out.println("请输入三角形的行数：");
        int n = new Scanner(System.in).nextInt();

        for (int i = 1; i < n; i++) {
            //每行多少个*
            /*
                  *
                 ***
                *****
               *******
                ...
            * */
            for (int k = 0; k < n - i; k++) {
                System.out.print(' ');
            }

            /*
            * 打印*
            * (i-1)*2+1
            * */
            for (int j = 0; j < (i-1)*2+1; j++) {
                System.out.print('*');
            }
            System.out.println();

        }


    }

}
